//
//  UIImage+WLCompress.h
//  JYParent
//
//  Created by 倪望龙 on 2017/12/16.
//  Copyright © 2017年 互动家园. All rights reserved.
//

#import <UIKit/UIKit.h>


@interface UIImage (MJUICompress)
/*
 *  压缩图片方法(先压缩质量再压缩尺寸) 压缩到指定大小
 */
-(NSData *)mj_compressWithLengthLimit:(NSUInteger)maxLength;
/*
 *  压缩图片方法(压缩质量)
 */
-(NSData *)mj_compressQualityWithLengthLimit:(NSInteger)maxLength;
/*
 *  压缩图片方法(压缩质量二分法)
 */
-(NSData *)mj_compressMidQualityWithLengthLimit:(NSInteger)maxLength;
/*
 *  压缩图片方法(压缩尺寸)
 */
-(NSData *)mj_compressBySizeWithLengthLimit:(NSUInteger)maxLength;

/// 计算图片大小
/// - Parameter image: image
- (NSString *)mj_calulateImageFileSize;

+ (NSData *)mj_compressNSDataWithImage:(UIImage *)sourceImage;

- (UIImage *)mj_compressToSize:(CGFloat)maxSizeKB;

- (UIImage *)mj_resizeImageTargetSize:(CGSize)targetSize;
@end
